<?php
namespace app\index\controller;

use think\Session;
use think\Cookie;
use app\index\model\Jour as J;
class SearchController extends BaseController{
	private $foot;

	public function _initialize(){
			$this->foot=$this->foot();
	}
	public function index(){
		$this->assign([
			'arr'=>Session::get('arr'),
			'foot'=>$this->foot
		]);
		return $this->fetch();
	}
	//搜索结果
	public function res(){
		$params=$this->request->param('search_res');
		if(!empty($params) ){
			//
			$arra[]=$params;
			Session::set('arr',$arra);
			$map['name']=array('like','%'.$params.'%');
		}else{
			$map=[];
		}
		
		$res=j::where($map)->select();
		$this->assign([
			'res'=>$res,
			'foot'=>$this->foot
		]);
		return $this->fetch();
	}
}